package edu.njfu.networkdemo.kotinlearning

import okhttp3.internal.threadName

class MyThread:Thread(){
    override fun run() {
        for(i in 1..50){
            println(this.name+":"+ i)
        }
    }
}

fun main() {
    val t1=MyThread2()
    val t2=MyThread2()
    Thread(t1).start()
    Thread(t2).start()
}
class MyThread2:Runnable{
    override fun run() {
        for(i in 1..50){
            println(javaClass.name+":"+ i)
        }
    }

}